import http from '@/utils/http.js'
const prefix = '/order'
export default {
	/**
	/* 根据id获取订单详情
	*/
	getById(params){
		return http.get(`${prefix}/getById`,params)
	},
	/**
	/* 创建订单
	*/
	createOrder(params){
		return http.post(`${prefix}/create`,params)
	},
	/**
	/* 尚未支付取消订单
	*/
	cancelUnpaidOrder(params){
		return http.put(`${prefix}/CancelUnpaidOrder`,params)
	},
	/**
	/* 支付订单
	*/
	kxPay(orderId){
		return http.post(`${prefix}/kxpay?orderId=${orderId}`,{})
	},
	/**
	/* 获取订单的物流信息
	*/
	getLogisticsInfo(params){
		return http.get(`${prefix}/getLogisticsInfo`,params)
	},
	/**
	/* 取消已支付的订单并退款
	*/
	cancelPaidOrder(params){
		return http.put(`${prefix}/cancelPaidOrder`,params)
	},
	/**
	/* 退货退款，需要理由和凭证
	*/
	goodsRefundApplication(params){
		return http.put(`${prefix}/GoodsRefund`,params)
	},
	/**
	/* 分页获取用户订单
	*/
	getUserOrderPage(params){
		return http.get(`${prefix}/getUserOrderPage`,params)
	},
	/**
	/* 订单分享，分享后订单状态变成已分享
	*/
	shareProductOrder(params){
		return http.put(`${prefix}/shareProductOrder`,params)
	},
	/**
	/* 计算购买下单可获得的积分数
	*/
	calCanUseIntegral(params){
		return http.get(`${prefix}/calCanUseIntegral`,params)
	},
	/**
	/* 计算运费
	*/
	calShipAmount(params){
		return http.post(`${prefix}/calShipAmount`,params)
	},
}
